Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting the triple-slash file:/// path, which comes out of pathlib… #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alensiljak
Copy link

correcting the triple-slash file:/// path, which comes out of pathlib.Path(x).as_uri()

@alensiljak
Copy link
Author

Hi!
Now there are a couple of pull requests that I need to have applied in parallel. Any chance of merging some of them? This one is easy, for example. Perhaps the scm-path fix requires some more testing in different environments.

@sdementen
Copy link
Owner

Tx ! Does those fixed also work on linux ?

@alensiljak
Copy link
Author

alensiljak commented Nov 23, 2017

I would say that this one does, at least. This is due to .to_uri() providing file:/// and, after replacement of file:// we are left with sqlite:////, which is then not recognized as the connection string (too many slashes).

For the others, like path adjustments, I'd appreciate if someone can try out on Linux and provide feedback.

On the other hand, I found that I can just be on a wild code branch, where I merge all the fixes I need at the moment so it's not so urgent. :)

@alensiljak
Copy link
Author

Ref: https://sqlite.org/c3ref/open.html, section URI filename examples.

@alensiljak
Copy link
Author

I'm not sure how to create tests for this.

@sdementen
Copy link
Owner

What puzzles me is that it worked on my Linux as it was before...

@alensiljak
Copy link
Author

alensiljak commented Nov 23, 2017

Could you try running report_portfolio_value.py directly? This is the one that was failing if run from command-line, without passing any parameters.
It is reading the db file from the settings and returns a file uri for the book_uri parameter.

@alensiljak
Copy link
Author

Btw, this manifests only now that I started using return pathlib.Path(self.database_path).as_uri() for converting a test file location to a book_uri in reports.
You can check on Linux how many slashes come out in the protocol spec for any file path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants